package demo;

import demo.pojo.RegisterRequest;
import demo.pojo.UserInfoRequest;
import demo.pojo.UserInfoResponse;
import demo.pojo.UserLoginResponse;
import demo.pojo.response.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "blog-user-info", path = "blog-user-info")
public interface BlogUserApi {
    @RequestMapping("/login")
    Result<UserLoginResponse> login(@RequestBody UserInfoRequest user);

    @RequestMapping("/getUserInfo")
    Result<UserLoginResponse> getUserInfo(@RequestParam("userId") Integer userId);

    @RequestMapping("/getAuthorInfo")
    Result<UserLoginResponse> getAuthorInfo(@RequestParam("blogId") Integer blogId);

    @RequestMapping("/register")
    Result<Integer> register(@RequestBody RegisterRequest request);
}
